package com.tuliyou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuliyou.entity.University;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UniversityMapper extends BaseMapper<University> {
    List<University> getUniversities(String name, String province, String city, String level, String attribute);

    @Select("select * from universities where university_code = #{universityCode} and uni_year = 2025 and is_deleted = 0")
    University getUniversityDetail(String universityCode);

    @Select("select name from universities where university_code = #{universityCode} and uni_year = 2025 and is_deleted = 0")
    String getNameByCode(String universityCode);

    @Select("select university_code from universities where name = #{universityName} and uni_year = #{enrollYear} and is_deleted = 0")
    String getCodeByNameAndEnrollYear(String universityName, Integer enrollYear);
}
